package com.ccb.sc.common.modules.shopkeeper.enums;

import com.baomidou.mybatisplus.annotation.IEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;

/**
 * @author ken
 * @version 1.0
 * @date 2020-09-25
 */
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
@Getter
public enum WithdrawType implements IEnum<Integer> {

    /**
     * 提现类型 0支付宝 1银行卡
     */
    ALIPAY(0, "支付宝"),

    BANK(1, "银行卡"),

    ;

    private final int value;
    private final String desc;

    WithdrawType(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    @Override
    public Integer getValue() {
        return this.value;
    }

    public static WithdrawType getByValue(int value) {
        for (WithdrawType orderStatus : WithdrawType.values()) {
            if (value == orderStatus.getValue()) {
                return orderStatus;
            }
        }
        return null;
    }
}
